/******************************************************************************************
  Copyright 2013 Andrea Ragusa

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
******************************************************************************************/

/*
   This file has been generated by IDA Pro.
   It contains local type definitions from
     C:\Documents and Settings\Andrea\Documenti\LASTSERV\LastChaos\Helper\Helper.idb
*/

/*    1 */
struct CConfigFile
{
  char char0;
  _BYTE f1[4095];
  _DWORD dword1000;
};

/*    2 */
struct CConfigFileData
{
  _BYTE byte0;
  _BYTE f1[255];
  _BYTE byte100;
  _BYTE f101[255];
  _BYTE byte200;
};

/*    3 */
struct CDBCmd
{
  _DWORD dword0;
  _DWORD dword4;
  _DWORD dword8;
  _BYTE fC[4];
  _DWORD dword10;
  _DWORD dword14;
  _BYTE byte18;
  _BYTE f19[4095];
  _DWORD dword1018;
  _DWORD dword101C;
};

/*   57 */ typedef char my_bool;

/*   58 */
enum enum_server_command
{
  COM_SLEEP = 0x0,
  COM_QUIT = 0x1,
  COM_INIT_DB = 0x2,
  COM_QUERY = 0x3,
  COM_FIELD_LIST = 0x4,
  COM_CREATE_DB = 0x5,
  COM_DROP_DB = 0x6,
  COM_REFRESH = 0x7,
  COM_SHUTDOWN = 0x8,
  COM_STATISTICS = 0x9,
  COM_PROCESS_INFO = 0xA,
  COM_CONNECT = 0xB,
  COM_PROCESS_KILL = 0xC,
  COM_DEBUG = 0xD,
  COM_PING = 0xE,
  COM_TIME = 0xF,
  COM_DELAYED_INSERT = 0x10,
  COM_CHANGE_USER = 0x11,
  COM_BINLOG_DUMP = 0x12,
  COM_TABLE_DUMP = 0x13,
  COM_CONNECT_OUT = 0x14,
  COM_REGISTER_SLAVE = 0x15,
  COM_STMT_PREPARE = 0x16,
  COM_STMT_EXECUTE = 0x17,
  COM_STMT_SEND_LONG_DATA = 0x18,
  COM_STMT_CLOSE = 0x19,
  COM_STMT_RESET = 0x1A,
  COM_SET_OPTION = 0x1B,
  COM_STMT_FETCH = 0x1C,
  COM_DAEMON = 0x1D,
  COM_END = 0x1E,
};

/*   59 */

/*   60 */
struct st_vio Vio;

/*   61 */
struct st_net
{
  Vio *vio;
  unsigned __int8 *buff;
  unsigned __int8 *buff_end;
  unsigned __int8 *write_pos;
  unsigned __int8 *read_pos;
  SOCKET fd;
  unsigned uint32_t remain_in_buf;
  unsigned uint32_t length;
  unsigned uint32_t buf_length;
  unsigned uint32_t where_b;
  unsigned uint32_t max_packet;
  unsigned uint32_t max_packet_size;
  unsigned int pkt_nr;
  unsigned int compress_pkt_nr;
  unsigned int write_timeout;
  unsigned int read_timeout;
  unsigned int retry_count;
  int fcntl;
  unsigned int *return_status;
  unsigned __int8 reading_or_writing;
  char save_char;
  my_bool unused1;
  my_bool unused2;
  my_bool compress;
  my_bool unused3;
  unsigned __int8 *unused;
  unsigned int last_errno;
  unsigned __int8 error;
  my_bool unused4;
  my_bool unused5;
  char last_error[512];
  char sqlstate[6];
  void *extension;
};

/*   62 */
enum enum_field_types
{
  MYSQL_TYPE_DECIMAL = 0x0,
  MYSQL_TYPE_TINY = 0x1,
  MYSQL_TYPE_SHORT = 0x2,
  MYSQL_TYPE_LONG = 0x3,
  MYSQL_TYPE_FLOAT = 0x4,
  MYSQL_TYPE_DOUBLE = 0x5,
  MYSQL_TYPE_NULL = 0x6,
  MYSQL_TYPE_TIMESTAMP = 0x7,
  MYSQL_TYPE_LONGLONG = 0x8,
  MYSQL_TYPE_INT24 = 0x9,
  MYSQL_TYPE_DATE = 0xA,
  MYSQL_TYPE_TIME = 0xB,
  MYSQL_TYPE_DATETIME = 0xC,
  MYSQL_TYPE_YEAR = 0xD,
  MYSQL_TYPE_NEWDATE = 0xE,
  MYSQL_TYPE_VARCHAR = 0xF,
  MYSQL_TYPE_BIT = 0x10,
  MYSQL_TYPE_NEWDECIMAL = 0xF6,
  MYSQL_TYPE_ENUM = 0xF7,
  MYSQL_TYPE_SET = 0xF8,
  MYSQL_TYPE_TINY_BLOB = 0xF9,
  MYSQL_TYPE_MEDIUM_BLOB = 0xFA,
  MYSQL_TYPE_LONG_BLOB = 0xFB,
  MYSQL_TYPE_BLOB = 0xFC,
  MYSQL_TYPE_VAR_STRING = 0xFD,
  MYSQL_TYPE_STRING = 0xFE,
  MYSQL_TYPE_GEOMETRY = 0xFF,
};

/*   63 */
enum mysql_enum_shutdown_level
{
  SHUTDOWN_DEFAULT = 0x0,
  SHUTDOWN_WAIT_CONNECTIONS = 0x1,
  SHUTDOWN_WAIT_TRANSACTIONS = 0x2,
  SHUTDOWN_WAIT_UPDATES = 0x8,
  SHUTDOWN_WAIT_ALL_BUFFERS = 0x10,
  SHUTDOWN_WAIT_CRITICAL_BUFFERS = 0x11,
  KILL_CONNECTION = 0xFF,
};

/*   64 */
enum enum_cursor_type
{
  CURSOR_TYPE_NO_CURSOR = 0x0,
  CURSOR_TYPE_READ_ONLY = 0x1,
  CURSOR_TYPE_FOR_UPDATE = 0x2,
  CURSOR_TYPE_SCROLLABLE = 0x4,
};

/*   65 */
enum enum_mysql_set_option
{
  MYSQL_OPTION_MULTI_STATEMENTS_ON = 0x0,
  MYSQL_OPTION_MULTI_STATEMENTS_OFF = 0x1,
};

/*   66 */
struct rand_struct
{
  unsigned uint32_t seed1;
  unsigned uint32_t seed2;
  unsigned uint32_t max_value;
  double max_value_dbl;
};

/*   67 */
enum Item_result
{
  STRING_RESULT = 0x0,
  REAL_RESULT = 0x1,
  INT_RESULT = 0x2,
  ROW_RESULT = 0x3,
  DECIMAL_RESULT = 0x4,
};

/*   68 */
struct st_udf_args
{
  unsigned int arg_count;
  enum Item_result *arg_type;
  char **args;
  unsigned uint32_t *lengths;
  char *maybe_null;
  char **attributes;
  unsigned uint32_t *attribute_lengths;
  void *extension;
};

/*   69 */
struct st_udf_args UDF_ARGS;

/*   70 */
struct st_udf_init
{
  my_bool maybe_null;
  unsigned int decimals;
  unsigned uint32_t max_length;
  char *ptr;
  my_bool const_item;
  void *extension;
};

/*   71 */
struct st_udf_init UDF_INIT;

/*   72 */
enum enum_mysql_timestamp_type
{
  MYSQL_TIMESTAMP_NONE = 0xFFFFFFFE,
  MYSQL_TIMESTAMP_ERROR = 0xFFFFFFFF,
  MYSQL_TIMESTAMP_DATE = 0x0,
  MYSQL_TIMESTAMP_DATETIME = 0x1,
  MYSQL_TIMESTAMP_TIME = 0x2,
};

/*   73 */
struct st_mysql_time
{
  unsigned int year;
  unsigned int month;
  unsigned int day;
  unsigned int hour;
  unsigned int minute;
  unsigned int second;
  unsigned uint32_t second_part;
  my_bool neg;
  enum enum_mysql_timestamp_type time_type;
};

/*   74 */
struct st_mysql_time MYSQL_TIME;

/*   75 */
struct st_list
{
  struct st_list *prev;
  struct st_list *next;
  void *data;
};

/*   76 */
struct st_list LIST;

/*   77 */ typedef int (*list_walk_action)(void *, void *);

/*   78 */
struct st_mysql_field
{
  char *name;
  char *org_name;
  char *table;
  char *org_table;
  char *db;
  char *catalog;
  char *def;
  unsigned uint32_t length;
  unsigned uint32_t max_length;
  unsigned int name_length;
  unsigned int org_name_length;
  unsigned int table_length;
  unsigned int org_table_length;
  unsigned int db_length;
  unsigned int catalog_length;
  unsigned int def_length;
  unsigned int flags;
  unsigned int decimals;
  unsigned int charsetnr;
  enum enum_field_types type;
  void *extension;
};

/*   79 */
struct st_mysql_field MYSQL_FIELD;

/*   80 */ typedef char **MYSQL_ROW;

/*   81 */ typedef unsigned int MYSQL_FIELD_OFFSET;

/*   82 */ typedef unsigned __int64 my_ulonglong;

/*   83 */
struct st_used_mem
{
  struct st_used_mem *next;
  unsigned int left;
  unsigned int size;
};

/*   84 */
struct st_used_mem USED_MEM;

/*   85 */
struct st_mem_root
{
  USED_MEM *free;
  USED_MEM *used;
  USED_MEM *pre_alloc;
  size_t min_malloc;
  size_t block_size;
  unsigned int block_num;
  unsigned int first_block_usage;
  void (*error_handler)(void);
};

/*   86 */
struct st_mem_root MEM_ROOT;

/*   87 */
struct st_typelib
{
  unsigned int count;
  const char *name;
  const char **type_names;
  unsigned int *type_lengths;
};

/*   88 */
struct st_typelib TYPELIB;

/*   89 */
struct st_mysql_rows
{
  struct st_mysql_rows *next;
  MYSQL_ROW data;
  unsigned uint32_t length;
};

/*   90 */
struct st_mysql_rows MYSQL_ROWS;

/*   91 */ typedef MYSQL_ROWS *MYSQL_ROW_OFFSET;

/*   92 */

/*   93 */
struct embedded_query_result EMBEDDED_QUERY_RESULT;

/*   94 */
struct st_mysql_data
{
  MYSQL_ROWS *data;
  struct embedded_query_result *embedded_info;
  MEM_ROOT alloc;
  my_ulonglong rows;
  unsigned int fields;
  void *extension;
};

/*   95 */
struct st_mysql_data MYSQL_DATA;

/*   96 */
enum mysql_option
{
  MYSQL_OPT_CONNECT_TIMEOUT = 0x0,
  MYSQL_OPT_COMPRESS = 0x1,
  MYSQL_OPT_NAMED_PIPE = 0x2,
  MYSQL_INIT_COMMAND = 0x3,
  MYSQL_READ_DEFAULT_FILE = 0x4,
  MYSQL_READ_DEFAULT_GROUP = 0x5,
  MYSQL_SET_CHARSET_DIR = 0x6,
  MYSQL_SET_CHARSET_NAME = 0x7,
  MYSQL_OPT_LOCAL_INFILE = 0x8,
  MYSQL_OPT_PROTOCOL = 0x9,
  MYSQL_SHARED_MEMORY_BASE_NAME = 0xA,
  MYSQL_OPT_READ_TIMEOUT = 0xB,
  MYSQL_OPT_WRITE_TIMEOUT = 0xC,
  MYSQL_OPT_USE_RESULT = 0xD,
  MYSQL_OPT_USE_REMOTE_CONNECTION = 0xE,
  MYSQL_OPT_USE_EMBEDDED_CONNECTION = 0xF,
  MYSQL_OPT_GUESS_CONNECTION = 0x10,
  MYSQL_SET_CLIENT_IP = 0x11,
  MYSQL_SECURE_AUTH = 0x12,
  MYSQL_REPORT_DATA_TRUNCATION = 0x13,
  MYSQL_OPT_RECONNECT = 0x14,
  MYSQL_OPT_SSL_VERIFY_SERVER_CERT = 0x15,
  MYSQL_PLUGIN_DIR = 0x16,
  MYSQL_DEFAULT_AUTH = 0x17,
};

/*   97 */

/*   98 */
struct st_mysql_options
{
  unsigned int connect_timeout;
  unsigned int read_timeout;
  unsigned int write_timeout;
  unsigned int port;
  unsigned int protocol;
  unsigned uint32_t client_flag;
  char *host;
  char *user;
  char *password;
  char *unix_socket;
  char *db;
  struct st_mysql_options::st_dynamic_array *init_commands;
  char *my_cnf_file;
  char *my_cnf_group;
  char *charset_dir;
  char *charset_name;
  char *ssl_key;
  char *ssl_cert;
  char *ssl_ca;
  char *ssl_capath;
  char *ssl_cipher;
  char *shared_memory_base_name;
  unsigned uint32_t max_allowed_packet;
  my_bool use_ssl;
  my_bool compress;
  my_bool named_pipe;
  my_bool unused1;
  my_bool unused2;
  my_bool unused3;
  my_bool unused4;
  enum mysql_option methods_to_use;
  char *client_ip;
  my_bool secure_auth;
  my_bool report_data_truncation;
  int (*local_infile_init)(void **, const char *, void *);
  int (*local_infile_read)(void *, char *, unsigned int);
  void (*local_infile_end)(void *);
  int (*local_infile_error)(void *, char *, unsigned int);
  void *local_infile_userdata;
  struct st_mysql_options_extention *extension;
};

/*   99 */
enum mysql_status
{
  MYSQL_STATUS_READY = 0x0,
  MYSQL_STATUS_GET_RESULT = 0x1,
  MYSQL_STATUS_USE_RESULT = 0x2,
  MYSQL_STATUS_STATEMENT_GET_RESULT = 0x3,
};

/*  100 */
enum mysql_protocol_type
{
  MYSQL_PROTOCOL_DEFAULT = 0x0,
  MYSQL_PROTOCOL_TCP = 0x1,
  MYSQL_PROTOCOL_SOCKET = 0x2,
  MYSQL_PROTOCOL_PIPE = 0x3,
  MYSQL_PROTOCOL_MEMORY = 0x4,
};

/*  101 */
struct character_set
{
  unsigned int number;
  unsigned int state;
  const char *csname;
  const char *name;
  const char *comment;
  const char *dir;
  unsigned int mbminlen;
  unsigned int mbmaxlen;
};

/*  102 */
struct character_set MY_CHARSET_INFO;

/*  103 */

/*  104 */
struct st_mysql_stmt
{
  MEM_ROOT mem_root;
  LIST list;
  MYSQL *mysql;
  MYSQL_BIND *params;
  MYSQL_BIND *bind;
  MYSQL_FIELD *fields;
  MYSQL_DATA result;
  MYSQL_ROWS *data_cursor;
  int (*read_row_func)(struct st_mysql_stmt *stmt, unsigned __int8 **row);
  my_ulonglong affected_rows;
  my_ulonglong insert_id;
  unsigned uint32_t stmt_id;
  unsigned uint32_t flags;
  unsigned uint32_t prefetch_rows;
  unsigned int server_status;
  unsigned int last_errno;
  unsigned int param_count;
  unsigned int field_count;
  enum enum_mysql_stmt_state state;
  char last_error[512];
  char sqlstate[6];
  my_bool send_types_to_server;
  my_bool bind_param_done;
  unsigned __int8 bind_result_done;
  my_bool unbuffered_fetch_cancelled;
  my_bool update_max_length;
  struct st_mysql_stmt_extension *extension;
};

/*  105 */
struct st_mysql
{
  NET net;
  unsigned __int8 *connector_fd;
  char *host;
  char *user;
  char *passwd;
  char *unix_socket;
  char *server_version;
  char *host_info;
  char *info;
  char *db;
  struct st_mysql::charset_info_st *charset;
  MYSQL_FIELD *fields;
  MEM_ROOT field_alloc;
  my_ulonglong affected_rows;
  my_ulonglong insert_id;
  my_ulonglong extra_info;
  unsigned uint32_t thread_id;
  unsigned uint32_t packet_length;
  unsigned int port;
  unsigned uint32_t client_flag;
  unsigned uint32_t server_capabilities;
  unsigned int protocol_version;
  unsigned int field_count;
  unsigned int server_status;
  unsigned int server_language;
  unsigned int warning_count;
  struct st_mysql_options options;
  enum mysql_status status;
  my_bool free_me;
  my_bool reconnect;
  char scramble[21];
  my_bool unused1;
  void *unused2;
  void *unused3;
  void *unused4;
  void *unused5;
  LIST *stmts;
  const struct st_mysql_methods *methods;
  void *thd;
  my_bool *unbuffered_fetch_owner;
  char *info_buffer;
  void *extension;
};

/*  106 */
struct st_mysql_res
{
  my_ulonglong row_count;
  MYSQL_FIELD *fields;
  MYSQL_DATA *data;
  MYSQL_ROWS *data_cursor;
  unsigned uint32_t *lengths;
  MYSQL *handle;
  const struct st_mysql_methods *methods;
  MYSQL_ROW row;
  MYSQL_ROW current_row;
  MEM_ROOT field_alloc;
  unsigned int field_count;
  unsigned int current_field;
  my_bool eof;
  my_bool unbuffered_fetch_cancelled;
  void *extension;
};

/*  107 */
struct st_mysql_parameters
{
  unsigned uint32_t *p_max_allowed_packet;
  unsigned uint32_t *p_net_buffer_length;
  void *extension;
};

/*  108 */
struct st_mysql_parameters MYSQL_PARAMETERS;

/*  109 */ typedef int SOCKET;

/*  110 */
struct st_net NET;

/*  111 */
struct st_mysql MYSQL;

/*  112 */
struct st_mysql_res MYSQL_RES;

/*  113 */
enum enum_mysql_stmt_state
{
  MYSQL_STMT_INIT_DONE = 0x1,
  MYSQL_STMT_PREPARE_DONE = 0x2,
  MYSQL_STMT_EXECUTE_DONE = 0x3,
  MYSQL_STMT_FETCH_DONE = 0x4,
};

/*  114 */
struct st_mysql_bind
{
  unsigned uint32_t *length;
  my_bool *is_null;
  void *buffer;
  my_bool *error;
  unsigned __int8 *row_ptr;
  void (*store_param_func)(NET *net, struct st_mysql_bind *param);
  void (*fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *, unsigned __int8 **row);
  void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *, unsigned __int8 **row);
  unsigned uint32_t buffer_length;
  unsigned uint32_t offset;
  unsigned uint32_t length_value;
  unsigned int param_number;
  unsigned int pack_length;
  enum enum_field_types buffer_type;
  my_bool error_value;
  my_bool is_unsigned;
  my_bool long_data_used;
  my_bool is_null_value;
  void *extension;
};

/*  115 */
struct st_mysql_bind MYSQL_BIND;

/*  116 */

/*  117 */
struct st_mysql_stmt MYSQL_STMT;

/*  118 */
enum enum_stmt_attr_type
{
  STMT_ATTR_UPDATE_MAX_LENGTH = 0x0,
  STMT_ATTR_CURSOR_TYPE = 0x1,
  STMT_ATTR_PREFETCH_ROWS = 0x2,
};


/* End of file */
